package com.itheima.service.system.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.itheima.dao.system.SysLogDao;
import com.itheima.domain.system.SysLog;
import com.itheima.service.system.SysLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SysLogServiceImpl implements SysLogService {

    @Autowired
    private SysLogDao sysLogDao;

    public PageInfo<SysLog> findAll(int page, int pageSize, String companyId) {
        PageHelper.startPage(page, pageSize);
        List<SysLog> list = sysLogDao.findAll(companyId);
        return new PageInfo<SysLog>(list,5);
    }

    public void save(SysLog sysLog) {
        sysLogDao.save(sysLog);
    }
}
